import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt(),k=sc.nextInt();
        long[] arr=new long[n];
        PriorityQueue<Integer> heap=new PriorityQueue<>((a,b)->{return b-a;});
        long sum=0;
        for(int i=0;i<n;i++){
            arr[i]=sc.nextLong();
            if(arr[i]%2==0){
                heap.add((int)arr[i]);
            }
            sum+=arr[i];
        }
        while(!heap.isEmpty()&&k>0){
            long x=heap.poll()/2;
            sum-=x;
            if(x%2==0){
                heap.add((int)x);
            }
            k--;
        }
        System.out.println(sum);
    }
}